package day9;

import java.util.Random;
import java.util.Scanner;

public class t11 {
    public static void main(String[] args) {
        Random r=new Random();
        String str=getstr();
        char[] arr=str.toCharArray();
        for (int i = 0; i < arr.length; i++) {
            char temp;
            int j=r.nextInt(arr.length);
            temp=arr[i];
            arr[i]=arr[j];
            arr[j]=temp;
        }
        String str1 = new String(arr);
        System.out.print("打乱后的字符串为：");
        System.out.println(str1);
    }

    public static String getstr() {
        Scanner sc =new Scanner(System.in);
        System.out.print("请输入字符串：");
        String str =sc.next();
        return str;
    }
}
